import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
for port in range(8999, 9999):
    try:
        print "[+] Attempting to connect to 192.168.0.14:" + str(port)
        s.connect(('192.168.0.14', port))
        s.send('Primal Security \n')
        banner = s.recv(1024)
        if banner:
            print "[+] Port " + str(port) + " open: " + banner
        s.close()
    except:
        pass
